//
//  XLContributionTableViewCell.m
//  XiangLove
//
//  Created by feng song on 2018/3/14.
//  Copyright © 2018年 BAOMIHUA.COM. All rights reserved.
//

#import "XLContributionTableViewCell.h"

@implementation XLContributionTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        self.contentView.backgroundColor = RGB(26, 25, 38);
        [self setupView];
    }
    return self;
}

-(void)setupView
{
    _rankImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:_rankImageView];
    [_rankImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(20);
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(21, 29));
    }];
    
    _rankLabel = [[UILabel alloc] init];
    _rankLabel.font = [UIFont systemFontOfSize:17];
    _rankLabel.textColor = RGB(255, 255, 255);
    [self.contentView addSubview:_rankLabel];
    [_rankLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(26);
        make.centerY.equalTo(self.contentView.mas_centerY);
    }];
    
//    _avatarImageView = [[UIImageView alloc] init];
//    _avatarImageView.layer.cornerRadius = 24;
//    _avatarImageView.layer.masksToBounds = YES;
//    _avatarImageView.layer.borderWidth = 1;
//    [self.contentView addSubview:_avatarImageView];
//    [_avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.size.mas_equalTo(CGSizeMake(48, 48));
//        make.left.equalTo(_rankImageView.mas_right).offset(11);
//        make.centerY.equalTo(_rankImageView);
//    }];
    
    _nickNameLabel = [[UILabel alloc] init];
    _nickNameLabel.font = [UIFont systemFontOfSize:16];
    _nickNameLabel.textColor = RGB_HEX(0xffffff);
    [self.contentView addSubview:_nickNameLabel];
    [_nickNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(65);
        make.top.equalTo(self.contentView.mas_top).offset(21);
        make.right.equalTo(self.contentView.mas_right).offset(-50);
    }];
    self.levelImage = [[UIImageView alloc]init];
//    _levelImage.backgroundColor = kWhiteColor;

    [self.contentView addSubview:_levelImage];
//    [_levelImage mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(_nickNameLabel.mas_top).offset(4);
//        make.left.equalTo(_nickNameLabel.mas_right).offset(10);
//        make.size.mas_equalTo(CGSizeMake(30, 16));
//
//    }];
    _goldBeanLabel = [[UILabel alloc] init];
    _goldBeanLabel.textColor = RGB_HEX(0x9395a2);
    _goldBeanLabel.font = [UIFont systemFontOfSize:12];
    [self.contentView addSubview:_goldBeanLabel];
    [_goldBeanLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_nickNameLabel.mas_bottom).offset(4);
        make.left.equalTo(_nickNameLabel.mas_left);
    }];
    
    _privateState = [[UIButton alloc] init];
    [_privateState setBackgroundImage:[UIImage imageNamed:@"common_bg_but_jiage_n"] forState:UIControlStateNormal];
    [_privateState setTitle:@"撩" forState:UIControlStateNormal];
    _privateState.titleLabel.font = kSetFont(14.0);
    [self.contentView addSubview:_privateState];
    [_privateState mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.mas_right).offset(-15);
        make.centerY.equalTo(self.contentView);
    }];
    
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
